<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="tongbox tongbox5">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_enginname"></div></div>
            <div class="tuo"><div class="tit">联营方/委托方</div><div class="con" id="tong_lian_unit"></div></div>
            <div class="tuo"><div class="tit">待扣登记单号</div><div class="con" id="tong_number"></div></div>
            <div class="tuo"><div class="tit">本次登记待扣金额(元)</div><div class="con" id="tong_money"></div></div>
            <div class="tuo"><div class="tit">申请人</div><div class="con" id="tong_flowuser"></div></div>
        </div>

        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv colorlan" id="enginid_name" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">收取信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">待扣登记单号</td><td class="tv" id="number"></td><td class="tt">待扣摘要</td><td class="tv" id="zhai"></td></tr>
                <tr><td class="tt">本次登记待扣金额(元)</td><td class="tv" id="money" colspan="3"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>



        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_list">待扣明细</script>
            <div class="tableShow">
                <table id="datalist_list" lay-filter="datalist_list"></table>
            </div>
        </div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>

    <div class="showrrboxtext">
        <div class="table-box tablenes">
            <div class="title">费用扣收</div>
            <div class="tuo"><div class="tit">管理费费率(%)</div><div class="con" id="lian_guanrate">0</div></div>
            <div class="tuo"><div class="tit">应扣管理费(元)</div><div class="con" id="lian_guanfee">0</div></div>
            <div class="tuo"><div class="tit">已扣管理费(元)</div><div class="con" id="kou_guanfee">0</div></div>
            <div class="tuo"><div class="tit">待扣管理费(元)</div><div class="con" id="dai_guanfee">0</div></div>
            <div class="tuo"><div class="tit">税费费率(%)</div><div class="con" id="lian_shuirate">0</div></div>
            <div class="tuo"><div class="tit">应扣税费(元)</div><div class="con" id="lian_shuifee">0</div></div>
            <div class="tuo"><div class="tit">已扣税费(元)</div><div class="con" id="kou_shuifee">0</div></div>
            <div class="tuo"><div class="tit">待扣税费(元)</div><div class="con" id="dai_shuifee">0</div></div>
            <div class="tuo"><div class="tit">其他扣收金额(元)</div><div class="con" id="kou_qifee">0</div></div>
            <div class="tuo"><div class="tit">其他待扣金额(元)</div><div class="con" id="daikouqidaifee">0</div></div>
            <div class="tuo"><div class="tit">扣收合计(元)</div><div class="con" id="kou_allfee">0</div></div>
            <div class="tuo"><div class="tit">待扣合计(元)</div><div class="con" id="dai_allfee">0</div></div>
        </div>
    </div>
    <div><?php include '../public/shrrbox.php'?></div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_dai_kou_qi_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                $("#flowdingname").text(data.zhai);


                if(engininfo){
                    $("#tong_enginname").text(engininfo.name);
                    $("#tong_lian_unit").text(engininfo.lian_unit);
                }
                $("#tong_number").text(data.number);
                $("#tong_money").text(parseFormatNum(data.money));
                $("#tong_flowuser").text(data.flowuser);


                if(engininfo){
                    $("#lian_guanrate").text(engininfo.lian_guanrate).addClass('colorlan').click(function () {
                        openNavPage('查看联营合同信息','contract_lian/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#lian_guanfee").text(parseFormatNum(engininfo.lian_guanfee));
                    $("#kou_guanfee").text(parseFormatNum(engininfo.kou_guanfee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_glf&enginid='+engininfo.id);
                    });
                    $("#dai_guanfee").text(parseFormatNum(engininfo.dai_guanfee));
                    $("#lian_shuirate").text(engininfo.lian_shuirate).addClass('colorlan').click(function () {
                        openNavPage('查看联营合同信息','contract_lian/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#lian_shuifee").text(parseFormatNum(engininfo.lian_shuifee));
                    $("#kou_shuifee").text(parseFormatNum(engininfo.kou_shuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_sf&enginid='+engininfo.id);
                    });
                    $("#dai_shuifee").text(parseFormatNum(engininfo.dai_shuifee));
                    $("#kou_qifee").text(parseFormatNum(engininfo.kou_qifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=noguannoshui&enginid='+engininfo.id);
                    });
                    $("#daikouqidaifee").text(parseFormatNum(engininfo.daikouqidaifee)).addClass('colorlan').click(function () {
                        openNavPage('查看待扣登记信息','dai_kou_qi/detail.php?status=1&state=1&enginid='+engininfo.id);
                    });
                    $("#kou_allfee").text(parseFormatNum(engininfo.kou_allfee));
                    $("#dai_allfee").text(parseFormatNum(parseFloat(engininfo.dai_guanfee) + parseFloat(engininfo.dai_shuifee) + parseFloat(engininfo.daikouqidaifee)));
                }









                if(engininfo){
                    $("#enginid_name").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });
                }

                $("#number").text(data.number);
                $("#zhai").text(data.zhai);
                $("#money").text(parseFormatNum(data.money));
                $("#explain").text(data.explain);



                var mytableList = table.render({
                    elem: "#datalist_list",data:res.data.list, toolbar: '#toolbarDemo_gong', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field: 'feitype_name', title: '费用项'}
                        ,{field: 'money', title: '待扣金额(元)',align:'right',templet: function(d){return parseFormatNum(d.money);}}
                        ,{field: 'explain', title: '待扣说明'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });



                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('dai_kou_qi', param_id);
    });



</script>
</body>
</html>




